#pragma once
#include <d3d9.h>
#include <d3dx9.h>
#include "Face.h"

namespace Minicraft
{
	namespace CubeFaces
	{
		// An enum representing the 6 possible faces on a cube.
		enum e
		{
			Top = 0,
			Botton,
			North,
			East,
			South,
			West
		};
	}

	namespace CubeType
	{
		// Represents the game-type of this cube.
		enum e
		{
			Air = 0,
			Grass,
			Dirt
		};
	}

	class Cube
	{
	private:
		// The number of faces a cube have
		static const int NUM_OF_FACES = 6;

		// An array of this Cube's faces.
		Face* cubeFaces[Minicraft::Cube::NUM_OF_FACES];
		
		// A transformation that represents this cube's position in the world.
		D3DXMATRIX worldTransformation;

		// Whether or not *all* the faces of this cube render.
		bool visible;

		// These methods handle setting the cube to different types.
		void SetToAir();
		void SetToGrass();
		void SetToDirt();

		// Initalizes all the faces of this cube;
		void Initalize();

	public:
			// Ctor/Dtor
			Cube();
			Cube(D3DXMATRIX);
			~Cube();

			// Visible Accessor/Mutator
			bool GetVisible();
			void SetVisible(bool);

			// Specific Face Visible Accessor/Mutatior
			bool GetFaceVisible(enum Minicraft::CubeFaces::e);
			void SetFaceVisible(enum Minicraft::CubeFaces::e, bool);

			// Sets the type of cube this cube is.
			void SetType(Minicraft::CubeType::e);

			// Draw Method
			void Draw();
	};
}